namespace ShadeTree.Binding.Dialogs
{
    public class UserMessage
    {
        public string Body;
        public string Caption;
        public bool YesNo = false;


        public UserMessage(string caption, string message)
        {
            Caption = caption;
            Body = message;
        }


        public override bool Equals(object obj)
        {
            if (this == obj) return true;
            var userMessage = obj as UserMessage;
            if (userMessage == null) return false;
            return Equals(Caption, userMessage.Caption) && Equals(Body, userMessage.Body);
        }

        public override int GetHashCode()
        {
            return (Caption != null ? Caption.GetHashCode() : 0) + 29*(Body != null ? Body.GetHashCode() : 0);
        }


        public override string ToString()
        {
            return Body;
        }
    }
}